<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>test.pbl</title>
<meta name="generator" content="KF5::SyntaxHighlighting - Definition (Wesnoth Markup Language) - Theme (Breeze Dark)"/>
</head><body style="background-color:#232629;color:#cfcfc2"><pre>
<span style="color:#7a7c7d;"># Wesnoth Markup Language</span>

<span style="color:#27ae60;">#textdomain wesnoth-libs</span>

<span style="color:#27ae60;">#define __GUI_WINDOW_HEIGHT</span>
(
	if(<span style="color:#2980b9;">window_height </span>= 0, 9999, window_height)
)<span style="color:#27ae60;">#enddef</span>

<span style="color:#27ae60;">#define __GUI_WINDOW_FUNCTIONS</span>
def reevaluate_best_size(w, s)
(
[
	0,
<span style="color:#7a7c7d;">#</span>
	debug_print('window ', w),
	debug_print('screen ', s)
<span style="color:#7a7c7d;">#</span>
][0]
);
<span style="color:#27ae60;">#enddef</span>

<span style="color:#7a7c7d;"># Don't highlight array indices as tags</span>
stored_unit[1].moves
other[0][1][2]
other[foo][bar]

foo[<span style="color:#8e44ad;">{MACRO}</span>]
foo[<span style="color:#f67400;">$index</span>]
foo[  12 ]

<span style="color:#7a7c7d;"># Nested tags</span>
<span style="font-weight:bold;">[allow_undo][/allow_undo][not][true]</span>text<span style="font-weight:bold;">[/true][/not]</span>
<span style="font-weight:bold;">[foo][bar]</span>text<span style="font-weight:bold;">[/bar][/foo]</span>

<span style="font-weight:bold;">[about]</span>
	<span style="color:#2980b9;">title</span>= <span style="color:#f44f4f;">_ &quot;Campaign Designer&quot;</span>
	<span style="color:#2980b9;">text</span>=<span style="color:#f44f4f;">&quot;Your Name&quot;</span>
<span style="font-weight:bold;">[/about]</span>

<span style="font-weight:bold;">[window]</span>
	<span style="color:#2980b9;">id </span>= <span style="color:#f44f4f;">&quot;tooltip&quot;</span>

	<span style="font-weight:bold;">[resolution]</span>
		<span style="color:#2980b9;">definition </span>= <span style="color:#f44f4f;">&quot;tooltip&quot;</span>
		<span style="color:#2980b9;">automatic_placement </span>= false
		<span style="color:#2980b9;">functions </span>= <span style="color:#f44f4f;">&quot;</span><span style="color:#8e44ad;">{__GUI_WINDOW_FUNCTIONS}</span><span style="color:#f44f4f;">&quot;</span>

		<span style="font-weight:bold;">[grid]</span>

			<span style="font-weight:bold;">[row]</span>

				<span style="font-weight:bold;">[column]</span>

					<span style="font-weight:bold;">[label]</span>
						<span style="color:#2980b9;">id </span>= <span style="color:#f44f4f;">&quot;label&quot;</span>
						<span style="color:#2980b9;">definition </span>= <span style="color:#f44f4f;">&quot;default_small&quot;</span>

						<span style="color:#2980b9;">use_markup </span>= true
						<span style="color:#2980b9;">wrap </span>= true
					<span style="font-weight:bold;">[/label]</span>

				<span style="font-weight:bold;">[/column]</span>

			<span style="font-weight:bold;">[/row]</span>

		<span style="font-weight:bold;">[/grid]</span>

	<span style="font-weight:bold;">[/resolution]</span>

<span style="font-weight:bold;">[/window]</span>

<span style="font-weight:bold;">[event]</span>
	<span style="color:#2980b9;">name </span>= preload
	<span style="color:#2980b9;">first_time_only </span>= no
	<span style="font-weight:bold;">[lua]</span>
		<span style="color:#2980b9;">code </span>=<span style="color:#f44f4f;"> &lt;&lt;</span>
			<span style="font-weight:bold;">function</span> narrator(<span style="color:#5555ff;">t</span>)
				<span style="color:#7a7c7d;">-- Behave like the [message] tag.</span>
				<span style="color:#5555ff;">wesnoth</span>.fire(<span style="color:#f44f4f;">&quot;message&quot;</span>,
				  { <span style="color:#5555ff;">speaker</span> = <span style="color:#f44f4f;">&quot;narrator&quot;</span>, <span style="color:#5555ff;">message</span> = <span style="color:#5555ff;">t</span>.<span style="color:#5555ff;">sentence</span> })
			<span style="font-weight:bold;">end</span>
		<span style="color:#f44f4f;">&gt;&gt;</span>
	<span style="font-weight:bold;">[/lua]</span>
<span style="font-weight:bold;">[/event]</span>

<span style="font-weight:bold;">[event]</span>
	<span style="color:#2980b9;">name </span>= turn 1
	<span style="font-weight:bold;">[lua]</span>
		<span style="color:#2980b9;">code </span>=<span style="color:#f44f4f;"> &lt;&lt;</span> narrator(...) <span style="color:#f44f4f;">&gt;&gt;</span>
		<span style="font-weight:bold;">[args]</span>
			<span style="color:#2980b9;">sentence </span>= <span style="color:#f44f4f;">_ &quot;Hello world!&quot;</span>
		<span style="font-weight:bold;">[/args]</span>
	<span style="font-weight:bold;">[/lua]</span>
	<span style="font-weight:bold;">[lua]</span>
		<span style="color:#2980b9;">code </span>=<span style="color:#f44f4f;"> &lt;&lt;</span> narrator(...) <span style="color:#f44f4f;">&gt;&gt;</span>
		<span style="font-weight:bold;">[args]</span>
			<span style="color:#2980b9;">sentence </span>= <span style="color:#f44f4f;">_ &quot;How are you today?&quot;</span>
		<span style="font-weight:bold;">[/args]</span>
	<span style="font-weight:bold;">[/lua]</span>
<span style="font-weight:bold;">[/event]</span>
</pre></body></html>
